home *** CD-ROM | disk | FTP | other *** search
- scenario = GetProperties()
- scenario.ScenarioType = 1
- scenario.Title = "sc_Train_10_00"
- scenario.Map = "Beotorum.dat"
- scenario.Description = "sc_Train_10_01"
- scenario.iSortOrder = 5
- scenario.Picture = "Train 10.dds"
-
- scenario.vShowMessageBoxes[STDDT_GUERILLA] = false
- scenario.vShowMessageBoxes[STDDT_INITIAL_DISCLOSE] = false
- scenario.vShowMessageBoxes[STDDT_ORDINARY_DICLOSE] = false
- scenario.vShowMessageBoxes[STDDT_COMBAT_PHASE] = false
- scenario.vShowMessageBoxes[STDDT_SHOW_REVENUE] = false
- scenario.vShowMessageBoxes[STDDT_AUTOFINISH_GUERILLA] = false
- scenario.vShowMessageBoxes[STDDT_AUTOFINISH_COMBAT] = false
- scenario.vShowMessageBoxes[STDDT_AUTOFINISH_REVENUE] = false
- scenario.vShowMessageBoxes[STDDT_AUTOFINISH_DISCLOSE] = false
- scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_CAPITAL] = false
- scenario.vShowMessageBoxes[STDDT_YOU_CLEARED_TERRITORY] = false
- scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_COUNTRY] = false
- scenario.vShowMessageBoxes[STDDT_YOU_GOT_INDEMNITY] = false
- scenario.vShowMessageBoxes[STDDT_ENEMY_CLEARED_TERRITORY] = false
- scenario.vShowMessageBoxes[STDDT_ENEMY_INVADED] = false
- scenario.vShowMessageBoxes[STDDT_ENEMY_CAPTURED_COUNTRY] = false
- scenario.vShowMessageBoxes[STDDT_ENEMY_DISCLOSE] = false
- scenario.vShowMessageBoxes[STDDT_DICLOSE_COUNTRY] = false
- scenario.vShowMessageBoxes[STDDT_INVADE_COUNTRY] = false
-
- Player(PT_PLAYER, RACE_HUMANS)
- Player(PT_AI, RACE_ALIENS)
-
- SetInitialCamera(-0.321461, 0.000000, 0.946923, 0.000000, -0.818337, 0.503138, -0.277809, 0.000000,-0.476432, -0.864206, -0.161739, 0.000000,921.238403, 322.401733, -588.098572, 1.000000)
-
- function InitialMOB()
- StartMOB(1)
-
- ShowXBallon(53, -1, MBS_CENTER, 300, 300, "sc_Train_10_02")
-
- ShowXBallon(53, -1, MBS_CENTER, 300, 300, "sc_Train_10_03")
-
- InitCameraPointsList()
- AddCameraPoint(-0.991251, 0.000000, 0.131989, 0.000000, -0.115614, 0.482438, -0.868267, 0.000000,-0.063677, -0.875930, -0.478217, 0.000000,1114.590068, 343.047882, -956.012268, 1.000000)
- AddCameraPoint(-0.958943, -0.000000, 0.283596, 0.000000, -0.280194, 0.154431, -0.947440, 0.000000,-0.043796, -0.988003, -0.148090, 0.000000,1358.987183, 401.407166, -1087.509521, 1.000000)
- FlyCameraByPoints(1)
-
- ShowXBallon(53, -1, MBS_CENTER, 300, 300, "sc_Train_10_04")
-
- ShowXBallon(53, -1, MBS_CENTER, 300, 300, "sc_Train_10_05")
-
- MoveUnit( 4098, 22, 34 )
-
- ShowXBallon(53, -1, MBS_CENTER, 300, 900, "sc_Train_10_06")
-
- ShowXBallon(53, -1, MBS_CENTER, 300, 900, "sc_Train_10_07")
-
- MoveUnit( 2, 22, 38 )
- MoveUnit( 4, 23, 37 )
- pause(3)
- MoveUnit( 3, 23, 39 )
-
- ShowXBallon(53, -1, MBS_CENTER, 300, 900, "sc_Train_10_08")
-
- ShowXBallon(53, -1, MBS_CENTER, 300, 900, "sc_Train_10_09")
-
- FlyCamera(-0.698618, 0.000000, 0.715495, 0.000000, -0.692449, 0.251756, -0.676116, 0.000000,-0.180130, -0.967791, -0.175882, 0.000000,1471.120361, 429.965515, -1097.210815, 1.000000)
-
- ShowXBallon(53, -1, MBS_CENTER, 300, 900, "sc_Train_10_10")
-
- FinishMOB()
- end
-
- old_prompt = ""
-
- local bCanEndPhase = false
-
- function OnUpdate()
- bCanEndPhase = false
-
- if GetTurnNumber( COLOR_GREEN ) == 0 then
- if not IsInside( 4099 ) then
- if GetSelectedUnit() ~= 4099 then
- ShowPrompting("sc_Train_10_11")
- else
- ShowPrompting("sc_Train_10_12")
- end
- elseif not IsInside( 4100 ) then
- if GetSelectedUnit() ~= 4100 then
- ShowPrompting("sc_Train_10_13")
- elseif GetDistance( 4100, 4098 ) > 1 then
- ShowPrompting("sc_Train_10_14")
- else
- ShowPrompting("sc_Train_10_15")
- end
- elseif GetMP( 4098 ) > 0 and ( GetPos( 4098 ).x ~= 17 or GetPos( 4098 ).y ~= 31 ) then
- if GetSelectedUnit() ~= 4098 then
- ShowPrompting("sc_Train_10_16")
- elseif IsDesantInfoDisplaying() then
- ShowPrompting("sc_Train_10_17")
- else
- ShowPrompting("sc_Train_10_18")
- end
- elseif not IsInside( 4101 ) then
- if GetSelectedUnit() ~= 4101 then
- ShowPrompting("sc_Train_10_19")
- else
- ShowPrompting("sc_Train_10_12")
- end
- elseif not IsInside( 4102 ) then
- if GetSelectedUnit() ~= 4102 then
- ShowPrompting("sc_Train_10_21")
- else
- ShowPrompting("sc_Train_10_22")
- end
- elseif GetPos( 4098 ).x ~= 16 or GetPos( 4098 ).y ~= 30 then
- if GetSelectedUnit() ~= 4098 then
- ShowPrompting("sc_Train_10_16")
- elseif IsDesantInfoDisplaying() then
- ShowPrompting("sc_Train_10_17")
- else
- ShowPrompting("sc_Train_10_25")
- end
- end
- else
- for id = 4099, 4102 do
- if not IsInside( id ) and GetDistance( id, 1 ) <= GetMaxWR( id ) then
- if not HasFired( id ) then
- ShowPrompting("sc_Train_10_26")
- return
- end
- end
- end
-
- if GetPos( 4098 ).x ~= 13 or GetPos( 4098 ).y ~= 21 then
- if GetSelectedUnit() ~= 4098 then
- ShowPrompting("sc_Train_10_16")
- elseif IsDesantInfoDisplaying() then
- ShowPrompting("sc_Train_10_17")
- else
- ShowPrompting("sc_Train_10_29")
- end
- elseif GetType( IsHexFull(12, 20) ) == TANK then
- ShowPrompting("sc_Train_10_30")
- elseif IsInside( 4099 ) or IsInside( 4101 ) then
- if GetType( GetSelectedUnit() ) == TANK and IsInside( GetSelectedUnit() ) then
- ShowPrompting("sc_Train_10_31")
- elseif IsDesantInfoDisplaying() then
- ShowPrompting("sc_Train_10_32")
- else
- ShowPrompting("sc_Train_10_16")
- end
- elseif IsInside( 4100 ) then
- if GetSelectedUnit() == 4100 then
- ShowPrompting("sc_Train_10_34")
- elseif IsDesantInfoDisplaying() then
- ShowPrompting("sc_Train_10_35")
- else
- ShowPrompting("sc_Train_10_16")
- end
- elseif IsInside( 4102 ) then
- if GetSelectedUnit() == 4102 then
- ShowPrompting("sc_Train_10_37")
- elseif IsDesantInfoDisplaying() then
- ShowPrompting("sc_Train_10_38")
- else
- ShowPrompting("sc_Train_10_16")
- end
- end
- end
-
- if not HasPrompting() then
- ShowPrompting("sc_Train_finish_phase")
- bCanEndPhase = true
- end
- end
-
- function OnHexClicked(x, y, clicked_unit, selected_unit, command)
- if command == CMD_LOAD and ( IsInside( 4101 ) or IsInside( 4102 ) ) then
- pause()
- stop()
- StartMOB(1)
- ShowXBallon(53, -1, MBS_CENTER, 300, 300, "sc_Train_10_41")
- ShowXBallon(53, -1, MBS_CENTER, 300, 320, "sc_Train_10_42")
- FinishMOB()
- elseif command == CMD_LOAD and selected_unit == 4100 then
- pause()
- stop()
-
- StartMOB(1)
- FlyCamera(-0.888584, 0.000000, 0.458713, 0.000000, -0.452474, 0.164369, -0.876498, 0.000000,-0.075398, -0.986399, -0.146055, 0.000000,1194.484863, 494.967957, -1092.769653, 1.000000)
- ShowObject(ARROW, 1, 65280, 50, 25, 16, 30, 17, 31)
- ShowXBallon(51, -1, MBS_CENTER, 300, 350, "sc_Train_10_43")
- HideObject(1)
-
- FinishMOB()
- end
-
- if command == CMD_FIRE and clicked_unit ~= 1 then
- IncorrectAction("sc_Train_10_44")
- return
- end
-
- if GetTurnNumber( COLOR_GREEN ) == 0 then
- if command == CMD_MOVE then
- if selected_unit == 4099 or selected_unit == 4101 or selected_unit == 4102 then
- IncorrectAction("sc_Train_10_45")
- elseif selected_unit == 4100 then
- local p = GetPos( 4100 )
- if p.x ~= 23 or y ~= 35 then
- if x ~= 23 or y ~= 35 then
- IncorrectAction("sc_Train_10_46")
- end
- else
- IncorrectAction("sc_Train_10_45")
- end
- elseif selected_unit == 4098 then
- if not IsInside( 4099 ) or not IsInside( 4100 ) then
- IncorrectAction("sc_Train_10_51")
- elseif not IsInside( 4101 ) or not IsInside( 4102 ) then
- if x ~= 17 or y ~= 31 then
- IncorrectAction("sc_Train_10_49")
- end
- else
- if x ~= 16 or y ~= 30 then
- IncorrectAction("sc_Train_10_49")
- end
- end
- end
- elseif command == CMD_UNLOAD then
- IncorrectAction("sc_Train_10_51")
- end
- elseif GetTurnNumber( COLOR_GREEN ) == 1 then
- if selected_unit == 4098 then
- if command == CMD_MOVE then
- if x ~= 13 or y ~= 21 then
- IncorrectAction("sc_Train_10_52")
- end
- end
- elseif GetType( selected_unit ) == TANK then
- if command == CMD_UNLOAD then
- if x == 13 and y == 19 then
- IncorrectAction("sc_Train_10_53")
- elseif x ~= 12 or y ~= 20 then
- IncorrectAction("sc_Train_10_51")
- end
- elseif command == CMD_MOVE then
- if GetDistance( 1, x, y ) > 1 then
- IncorrectAction("sc_Train_10_51")
- end
- end
- elseif selected_unit == 4100 then
- if command == CMD_MOVE or command == CMD_UNLOAD then
- if GetDistance( 1, x, y ) > 2 then
- IncorrectAction("sc_Train_10_56")
- end
- end
- elseif selected_unit == 4102 then
- if command == CMD_MOVE or command == CMD_UNLOAD then
- if GetDistance( 1, x, y ) > 2 then
- IncorrectAction("sc_Train_10_57")
- end
- end
- end
- end
- end
-
- function OnUnitDead(unit)
- if unit == 1 then
- StartMOB(1)
- ShowXBallon(53, -1, MBS_CENTER, 300, 300, "sc_Train_10_58")
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_10_59")
- ShowXBallon(51, -1, MBS_CENTER, 300, 500, "sc_Train_10_60")
- ShowXBallon(51, -1, MBS_CENTER, 300, 500, "sc_Train_10_61")
- ShowXBallon(51, -1, MBS_CENTER, 300, 500, "sc_Train_10_62")
- ShowXBallon(51, -1, MBS_CENTER, 300, 500, "sc_Train_10_63")
- ShowXBallon(51, -1, MBS_CENTER, 300, 500, "sc_Train_10_64")
- FinishMOB()
- end
- end
-
- function OnEndTurn()
- StartMOB( 1 )
- SetMP(2, 0)
- SetMP(3, 0)
- SetMP(4, 0)
- FinishMOB()
- end
-
- function OnBeginPhase(phase)
- if GetTurnNumber( COLOR_GREEN ) == 1 then
- if phase == PHASE_COMBAT then
- StartMOB(1)
- FlyCamera(0.837925, 0.000000, 0.545786, 0.000000, -0.541839, 0.120047, 0.831865, 0.000000,-0.065520, -0.992768, 0.100590, 0.000000,971.832336, 658.708984, -930.020020, 1.000000)
- ShowObject(ARROW, 1, 65280, 100, 50, 14, 24, 13, 21)
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_10_65")
- HideObject(1)
- FinishMOB()
- end
- end
- end
-
- function OnEndAITurn()
- if GetTurnNumber( COLOR_GREEN ) == 1 then
- StartMOB( 1 )
- FlyCamera(-0.758360, 0.000000, 0.651835, 0.000000, -0.637716, 0.207011, -0.741933, 0.000000,-0.134937, -0.978339, -0.156989, 0.000000,1282.112427, 518.751343, -1054.979736, 1.000000)
- MoveUnit( 2, 21, 31 )
- pause(3)
- LoadUnit( 3, 4 )
- MoveUnit( 3, 19, 31 )
- UnloadUnit( 3, 4, 18, 30 )
- MoveUnit( 4, 17, 29 )
- Fire( 4, 4098 )
- pause(3)
- ShowXBallon(53, -1, MBS_CENTER, 300, 340, "sc_Train_10_66")
- ShowXBallon(53, -1, MBS_CENTER, 300, 300, "sc_Train_10_67")
- ShowXBallon(53, -1, MBS_CENTER, 300, 300, "sc_Train_10_68")
- RemoveDead()
- FinishMOB()
- end
- end
-
- function OnEndPhase( phase )
- if phase == PHASE_COMBAT then
- if not bCanEndPhase then
- IncorrectAction("sc_Train_10_51")
- end
- end
- end
-
- function CheckForVictory()
- if IsDead( 1 ) then return GAMERESULT_VICTORY end
- if GetAliveUnitsAmount( COLOR_GREEN ) == 0 then return GAMERESULT_DEFEAT end
- return GAMERESULT_NONE
- end
-
- function aiDefence(country)
- aiMustNot()
- end
-
- function InitialSetup()
-
- Country(2, ALLIANCE_NEUTRAL_FNU)
- Money(2, MONEY_TOTAL_REVENUE, 0)
- Country(17, ALLIANCE_NEUTRAL_FNU)
- Money(17, MONEY_TOTAL_REVENUE, 0)
-
- Country(15, ALLIANCE_NEUTRAL_FL)
- Money(15, MONEY_TOTAL_REVENUE, 0)
-
- SetupUnit( 1, GTOWERA, 11, 17 )
- SetupUnit( 2, BSHIPA, 21, 45 )
- SetupUnit( 3, NTRANSPA, 20, 48 )
- SetupUnit( 4, AMPHIBIAA, 22, 42 )
-
- SetupUnit( 4098, NTRANSP, 24, 44 )
- SetupUnit( 4099, TANK, 23, 35 )
- SetupUnit( 4100, HBOT, 24, 34 )
- SetupUnit( 4101, TANK, 18, 32 )
- SetupUnit( 4102, MORTAR, 17, 33 )
-
- end
-